package com.czl.module_storehouse.bean;


import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.czl.base.data.bean.tengyun.BorrowBean;
import com.czl.base.data.bean.tengyun.LocatListBean;
import com.czl.base.data.bean.tengyun.ReceiveBean;

/**
 * @author xubin
 */
public class StockInfoBean implements MultiItemEntity {

    public static final int TYPE_HEADER = 1;
    public static final int TYPE_LOCATION = 2;
    public static final int TYPE_RECEIVE = 3;

    private int itemType;
    private String headerTitle;

    private LocatListBean mLocatListBean;
    private ReceiveBean mReceiveBean;
    private BorrowBean mBorrowBean;
    private boolean isLastLocation;

    private String date;
    private String num;
    private String userName;
    private String leftName;
    private String rightName;
    private boolean isHeader;

    public boolean isHeader() {
        return isHeader;
    }

    public void setHeader(boolean header) {
        isHeader = header;
    }

    public boolean isLastLocation() {
        return isLastLocation;
    }

    public void setLastLocation(boolean lastLocation) {
        isLastLocation = lastLocation;
    }

    public StockInfoBean(int itemType) {
        this.itemType = itemType;
    }

    public StockInfoBean(int itemType, String headerTitle) {
        this.itemType = itemType;
        this.headerTitle = headerTitle;
    }

    public LocatListBean getLocatListBean() {
        return mLocatListBean;
    }

    public void setLocatListBean(LocatListBean locatListBean) {
        mLocatListBean = locatListBean;
    }

    public ReceiveBean getReceiveBean() {
        return mReceiveBean;
    }

    public String getLeftName() {
        return leftName;
    }

    public void setLeftName(String leftName) {
        this.leftName = leftName;
    }

    public String getRightName() {
        return rightName;
    }

    public void setRightName(String rightName) {
        this.rightName = rightName;
    }

    public void setReceiveBean(ReceiveBean receiveBean) {
        mReceiveBean = receiveBean;
        this.userName = receiveBean.getUserName();
        this.date = TimeUtils.millis2String(receiveBean.getDate(), "yyyy-MM-dd");
        this.num = String.valueOf(receiveBean.getNum());
    }

    public BorrowBean getBorrowBean() {
        return mBorrowBean;
    }

    public void setBorrowBean(BorrowBean borrowBean) {
        mBorrowBean = borrowBean;
        this.userName = borrowBean.getUserName();
        this.date = TimeUtils.millis2String(borrowBean.getDate(), "yyyy-MM-dd");
        this.num = String.valueOf(borrowBean.getNum());
    }

    public String getHeaderTitle() {
        return headerTitle;
    }

    public void setHeaderTitle(String headerTitle) {
        this.headerTitle = headerTitle;
    }

    public void setItemType(int itemType) {
        this.itemType = itemType;
    }

    @Override
    public int getItemType() {
        return itemType;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

}
